package com.software.graduationproject.modules.food.entity;

import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.v2coding.validate.CreateGroup;
import com.v2coding.validate.UpdateGroup;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.v2coding.mybatis.model.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.*;
import java.util.Date;
import java.math.BigDecimal;

/**
 * Food : 食品表
 * ---------------------------------------------------------------------------------------------------------------------
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("food")
@ApiModel(value = "Food", description = "食品表")
public class Food extends BaseModel<Food> {

    @TableField(value ="food_name")
    @ExcelProperty(value = "食品名称")
    @ApiModelProperty(value = "食品名称")
    @NotEmpty(groups = {CreateGroup.class, UpdateGroup.class}, message = "食品名称不能为空")
    @Size(groups = {CreateGroup.class, UpdateGroup.class}, max = 255, message = "食品名称长度不能超过255")
    private String foodName;

    @TableField(value ="food_describe")
    @ExcelProperty(value = "食品描述")
    @ApiModelProperty(value = "食品描述")
    @Size(groups = {CreateGroup.class, UpdateGroup.class}, max = 255, message = "食品描述长度不能超过255")
    private String foodDescribe;

    @TableField(value ="keyword_list")
    @ExcelProperty(value = "食品标签")
    @ApiModelProperty(value = "食品标签")
    @Size(groups = {CreateGroup.class, UpdateGroup.class}, max = 255, message = "食品标签长度不能超过255")
    private String keywordList;

    @TableField(value ="sales")
    @ExcelProperty(value = "销量")
    @ApiModelProperty(value = "销量")
    private Long sales;

    @TableField(value ="likeCount")
    @ExcelProperty(value = "点赞量")
    @ApiModelProperty(value = "点赞量")
    private Long likecount;

    @TableField(value ="price")
    @ExcelProperty(value = "价格")
    @ApiModelProperty(value = "价格")
    private Float price;

    @TableField(value ="weight")
    @ExcelProperty(value = "份数")
    @ApiModelProperty(value = "份数")
    private Integer weight;

    @TableField(value ="food_img")
    @ExcelProperty(value = "商品图")
    @ApiModelProperty(value = "商品图")
    private String foodImg;

    @TableField(value ="discount")
    @ExcelProperty(value = "折扣")
    @ApiModelProperty(value = "折扣")
    private Float discount;

    @TableField(value ="marketers_id")
    @ExcelProperty(value = "商家Id")
    @ApiModelProperty(value = "商家Id")
    @NotNull(groups = {CreateGroup.class, UpdateGroup.class}, message = "商家Id不能为空")
    private Long marketersId;

    @TableField(value ="taste")
    @ExcelProperty(value = "口味")
    @ApiModelProperty(value = "口味")
    @Size(groups = {CreateGroup.class, UpdateGroup.class}, max = 255, message = "口味字段不能超过255")
    private String taste;

    @TableField(value ="type_id")
    @ExcelProperty(value = "食品类型Id")
    @ApiModelProperty(value = "食品类型Id")
    @NotNull(groups = {CreateGroup.class, UpdateGroup.class}, message = "食品Id不能为空")
    private Long typeId;
}
